package com.example.springboot.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.springboot.entity.LeaveStu;
import com.example.springboot.entity.Student;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface LeaveStuMapper extends BaseMapper<LeaveStu> {


    @Update("update leavestu set isagree=#{isAgree}  where username=#{username} ")
    int agreeAccount(String username, String isAgree);

    @Select("select a.name,b.* from student a,leavestu b where a.username=b.username=#{username} LIKE CONCAT('%',#{search},'%') LIMIT #{offset}, #{limit}")
    List <LeaveStu> findByUserName(String username, String search, int offset, int limit);
}
